home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / lang / Python151_Src.lha / Python1.5_Source / Modules / pcre.h < prev    next >
C/C++ Source or Header  |  1998-04-03  |  2KB  |  82 lines

  1. /*************************************************
  2. *       Perl-Compatible Regular Expressions      *
  3. *************************************************/
  4.  
  5. /* Copyright (c) 1998 University of Cambridge */
  6.  
  7. #ifndef _PCRE_H
  8. #define _PCRE_H
  9.  
  10. #ifdef FOR_PYTHON
  11. #include "Python.h"
  12. #endif
  13.  
  14. /* Have to include stdlib.h in order to ensure that size_t is defined;
  15. it is needed here for malloc. */
  16.  
  17. #include <sys/types.h>
  18. #include <stdlib.h>
  19.  
  20. /* Allow for C++ users */
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /* Options */
  27.  
  28. #define PCRE_CASELESS        0x0001
  29. #define PCRE_EXTENDED        0x0002
  30. #define PCRE_ANCHORED        0x0004
  31. #define PCRE_MULTILINE       0x0008
  32. #define PCRE_DOTALL          0x0010
  33. #define PCRE_DOLLAR_ENDONLY  0x0020
  34. #define PCRE_EXTRA           0x0040
  35. #define PCRE_NOTBOL          0x0080
  36. #define PCRE_NOTEOL          0x0100
  37. #ifdef FOR_PYTHON
  38. #define PCRE_LOCALE          0x0200
  39. #endif
  40.  
  41. /* Exec-time error codes */
  42.  
  43. #define PCRE_ERROR_NOMATCH        (-1)
  44. #define PCRE_ERROR_BADREF         (-2)
  45. #define PCRE_ERROR_NULL           (-3)
  46. #define PCRE_ERROR_BADOPTION      (-4)
  47. #define PCRE_ERROR_BADMAGIC       (-5)
  48. #define PCRE_ERROR_UNKNOWN_NODE   (-6)
  49. #define PCRE_ERROR_NOMEMORY       (-7)
  50.  
  51. /* Types */
  52.  
  53. typedef void pcre;
  54. typedef void pcre_extra;
  55.  
  56. /* Store get and free functions. These can be set to alternative malloc/free
  57. functions if required. */
  58.  
  59. extern void *(*pcre_malloc)(size_t);
  60. extern void  (*pcre_free)(void *);
  61.  
  62. /* Functions */
  63.  
  64. #ifdef FOR_PYTHON
  65. extern pcre *pcre_compile(const char *, int, const char **, int *, PyObject *);
  66. extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
  67.   int, int, int, int *, int);
  68. #else
  69. extern pcre *pcre_compile(const char *, int, const char **, int *);
  70. extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
  71.   int, int, int *, int);
  72. #endif
  73. extern int pcre_info(const pcre *, int *, int *);
  74. extern pcre_extra *pcre_study(const pcre *, int, const char **);
  75. extern const char *pcre_version(void);
  76.  
  77. #ifdef __cplusplus
  78. }  /* extern "C" */
  79. #endif
  80.  
  81. #endif /* End of pcre.h */
  82.